package homework.work4;

import javax.management.relation.InvalidRoleInfoException;

public class Main {
    public static void main(String[] args) {
        INoReturnNoParam testNo=()->{
            System.out.println("testNo");
        };
        testNo.test();

        INoReturnOneParam testOne=(a)-> {
            System.out.println("testOne  "+a);
        };
        testOne.test(2);

        INoReturnTwoParam testTwo=(a,b)->{
            System.out.println("testTwo "+(a+b));
        };
        testTwo.test(3,4);

        //
        IHasReturnNoParam test1=()->{
            System.out.println("test1");
            return 0;
        };
        test1.test();


    }
}

//无返回值无参数的功能接口
@FunctionalInterface
interface INoReturnNoParam {
    void test();
}

//无返回值有一个参数的功能接口
@FunctionalInterface
interface INoReturnOneParam {
    void test(int a);
}

//无返回值两个参数的功能接口
@FunctionalInterface
interface INoReturnTwoParam {
    void test(int a, int b);
}

//有返回值无参数的功能接口
@FunctionalInterface
interface IHasReturnNoParam {
    int test();
}

//有返回值一个参数的功能接口
@FunctionalInterface
interface IHasReturnOneParam {
    int method(int a);
}

//有返回值两个参数的功能接口
@FunctionalInterface
interface IHasReturnTwoParam {
    int test(int a, int b);
}